/*    */ package com.engine;
/*    */ 
/*    */ import java.io.FileInputStream;
/*    */ import java.io.FileNotFoundException;
/*    */ import java.io.FileOutputStream;
/*    */ import java.io.IOException;
/*    */ import java.util.Properties;
/*    */ import org.apache.log4j.Category;
/*    */ 
/*    */ public class SaveConfig
/*    */ {
/* 12 */   static String fileprops = "sq.props";
/*    */   static Properties props;
/* 14 */   static SaveConfig INSTANCE = null;
/* 15 */   static final Category log = Category.getInstance(SaveConfig.class);
/*    */ 
/*    */   private static void createInstance(String fileprops) throws FileNotFoundException, IOException {
/* 18 */     INSTANCE = new SaveConfig(fileprops);
/*    */   }
/*    */ 
/*    */   public static synchronized SaveConfig getInstance(String fileprops) throws FileNotFoundException, IOException {
/* 22 */     if (INSTANCE == null) createInstance(fileprops);
/* 23 */     return INSTANCE;
/*    */   }
/*    */ 
/*    */   public static synchronized void removeInstance()
/*    */   {
/* 28 */     INSTANCE = null;
/*    */   }
/*    */ 
/*    */   private SaveConfig(String fileprops) throws FileNotFoundException, IOException
/*    */   {
/* 33 */     if (fileprops != null)
/* 34 */       fileprops = fileprops;
/* 35 */     props = new Properties();
/* 36 */     props.load(new FileInputStream(fileprops));
/*    */   }
/*    */ 
/*    */   public static void PUT(String key, String value)
/*    */   {
/* 41 */     log.info("put->key:" + key + ",value:" + value);
/* 42 */     props.put(key, value);
/*    */   }
/*    */ 
/*    */   public static void Close() throws FileNotFoundException, IOException {
/* 46 */     props.store(new FileOutputStream(fileprops), null);
/*    */   }
/*    */ }

/* Location:           F:\16 2\SQ.jar
 * Qualified Name:     com.engine.SaveConfig
 * JD-Core Version:    0.6.0
 */